package it.antonio.ilpizze.aop.pointcut;

import it.antonio.ilpizze.aop.Pointcut;
import it.antonio.ilpizze.reflection.MethodAccessor;

public class OrPointcut implements Pointcut {

	private Pointcut[] pointcuts;
	
	public OrPointcut(Pointcut[] pointcuts) {
		super();
		this.pointcuts = pointcuts;
	}

	@Override
	public boolean apply(MethodAccessor method) {
		for(Pointcut pointcut: pointcuts){
			if(pointcut.apply(method)){
				return true;
			}
		}
		return false;
	}

}
